package com.itheima.day07.循环;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;

public class Lambda {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("z");
        c.add("x");
        c.add("c");
        c.add("v");
        c.forEach(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println(s);
            }
        });
        c.forEach(s -> System.out.println(s));
        c.forEach(System.out::println);
    }
}
